import CryptoJS from 'crypto-js'

const HmacSHA1 = CryptoJS.HmacSHA1

class Store {
    static get(key) {
        let k = HmacSHA1(key, location.pathname).toString();
        return JSON.parse(localStorage[k] || null);
    }
    static put(key, value) {
        let k = HmacSHA1(key, location.pathname).toString();
        localStorage[k] = JSON.stringify(value);
    }
}

export default Store